import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redriect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: function () {
      return import( '../views/login.vue')
    }
  },
  {
    path: '/main',
    name: 'Main',
    component: function () {
      return import( '../views/Main.vue')
    },
    children: [
      {
        path: '/users',
        name: 'Users',
        component: function () {
          return import( '../views/user/Users.vue')
        }
      },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
